In our iPhone application I have a nsstring which can be a path of any location or file.
Now, I want to check that string(path) is locating a file or folder/director.
Is this possible in Cocoa to check the string path for file or directory, then please provide me the code or tell me the method.
Thank you.
Tarun Kumar
04-Jan-2016For checking existence of file or directory you can use NSFileManager:
[[NSFileManager defaultManager]fileExistsAtPath:path_name isDirectory:&directoryFlag];
Here we are providing complete example: